package com.custom.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.AnalogClock;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

import com.custom.R;
import com.custom.view.MRadioButton;

public class DateDemoActivity extends Activity implements
		OnCheckedChangeListener {
	private AnalogClock analogClock;
	private MRadioButton button;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.datedemo);
		initView();

	}

	private void initView() {
		analogClock = (AnalogClock) findViewById(R.id.datedemo_analogClock01);
		button = (MRadioButton) findViewById(R.id.mRadioButton);
		button.setOnCheckedChangeListener(this);
	}

	@Override
	public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
		switch (buttonView.getId()) {
		case R.id.mRadioButton:
			if (button.getValue()=="true") {
				button.setText(button.getValue());
				button.setValue("false");
			}else {
				button.setText(button.getValue());
				button.setValue("true");
			}
			break;

		}
	}
}
